<?php $this->load->view('admin/_begin') ?>
<?php $this->load->view('admin/' . $this->router->fetch_class() . '/_filter') ?>
<script type="text/javascript">
  $(document).ready(function(){
    $('#shortcuts').hide();
  });
</script>
<form accept-charset="utf-8" method="post" action="<?php echo site_url('admin/'.$this->router->fetch_class() . '/action') ?>">	
  <div id="filter-stage" style="display: block;">	
    <table border="0" class="table-list">
      <thead>
        <tr>
          <th class="align-center" with="30">
            <input type="checkbox" class="check-all" value="" name="action_to_all">
          </th>
          <th><?php echo $this->lang->line("label.rating.end_user_id") ?></th>
          <th><?php echo $this->lang->line("label.rating.ip") ?></th>
          <th><?php echo $this->lang->line("label.rating.date_rate") ?></th>
          <th><?php echo $this->lang->line("label.rating.point") ?></th>
          <th><?php echo $this->lang->line("label.rating.promotion_id") ?></th>
        </tr>
      </thead>
      <tbody>
        <?php 
        if(empty($objects)){ ?>
        <tr>
          <td colspan="6">
            <div class="no_data"><?php echo $this->lang->line('label.empty.data', 
                    $this->lang->line('label.'.$this->router->fetch_class().'s'))?></div>
          </td>
        </tr>
        <?php } foreach ($objects as $obj) { ?>
          <tr>
            <td class="align-center">
              <input type="checkbox" value="<?php echo $obj['id'] ?>" name="action_to[]">
            </td>
            <td>
              <?php
              $ref_obj = $this->end_user_model->get($obj["end_user_id"]);
              if ($ref_obj) {
                ?>
                <a href="<?php echo site_url('admin/'."end_user/show/" . $obj["end_user_id"]) ?>">
                  <?php echo $this->end_user_model->to_string($ref_obj) ?></a>
              <?php } ?>
            </td><td>
              <?php echo $obj["ip"] ?>
            </td><td>
              <?php echo empty($obj["date_rate"]) ? '' : date($this->setting_model->item('date_format'), $obj["date_rate"]) ?>
            </td><td>
              <?php echo $obj["point"] ?>
            </td><td>
              <?php
              $ref_obj = $this->promotion_model->get($obj["promotion_id"]);
              if ($ref_obj) {
                ?>
                <a href="<?php echo site_url('admin/'."promotion/show/" . $obj["promotion_id"]) ?>">
                  <?php echo $this->promotion_model->to_string($ref_obj) ?></a>
              <?php } ?>
            </td>            
          </tr>
        <?php } ?>
      </tbody>
    </table><div class="paging"><?php echo $paging ?></div>
  </div>  
  <div class="table_action_buttons">
    <button class="btn red confirm" value="delete" name="btnAction" type="submit" disabled="disabled">
      <span><?php echo $this->lang->line('btn.delete') ?></span>
    </button>
  </div>
</form>
<?php $this->load->view('admin/_end') ?>